home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / BUS / TMCM Software and Labs.sit / Software for TMCM 7_95 / Files for Lab 13 / Bugs < prev    next >
Text File  |  1995-07-07  |  695b  |  23 lines

  1. {
  2.   A very simple application of multitasking.
  3.   Several turtles are created, and each one
  4.   engages in a random walk.  (It looks sort of
  5.   like a bunch of bugs wandering randomly
  6.   around on the screen.)
  7.  
  8.   You will have to stop this program using the
  9.   "Kill Program" command in the "Run" menu.
  10. }
  11.  
  12. PenUp { You might want to remove this PenUp command;
  13.         then the "bugs" will leave "trails." }
  14.  
  15. fork(10)   { Creates 10 turtles; you might want
  16.              to try increasing the number of
  17.              turtles. }
  18.  
  19. LOOP
  20.    face( randomInt(360) )  { face in a random direction }
  21.    forward( randomInt(10) / 10 )  { go forward a random amount }
  22.    EXIT IF 1=2  { loop will never end }
  23. END LOOP